home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
351-375
/
359
/
dice
/
dice.lzh
/
lib
/
amiga
/
clwp.c
< prev
next >
Wrap
Text File
|
1990-04-19
|
986b
|
36 lines
/*
*
*/
typedef struct LWP {
struct MinNode Node;
long Bytes; /* total allocated bytes */
long Pc; /* program ctr */
long Sp; /* sp on entry */
long Regs[10]; /* D234567 A2356 */
long Aux[4]; /* aux reg save */
struct MinList List; /* event list */
} LWP;
#define RB_A5 8
static struct MinList LReadyList = { (struct MinNode *)&LReadyList.mlh_Tail, NULL, (struct MinNode *)&LReadyList.mlh_Head };
static struct MinList LWaitList = { (struct MinNode *)&LWaitList.mlh_Tail, NULL, (struct MinNode *)&LWaitList.mlh_Head };
_CLWPStart(pardesc, argSize, varSize, startPC)
{
long bytes = argSize + varSize + 4 + sizeof(LWP);
LWP *lwp;
if (lwp = AllocMem(bytes, MEMF_PUBLIC)) {
lwp->Bytes = bytes;
lwp->Pc = startPC;
lwp->Regs[RB_A5] = (long)lwp + sizeof(LWP) + varSize;
*(long *)((char *)lwp + sizeof(LWP) + varSize) = (long)lwp + 1;
NewList(&lwp->List);
AddTail(&LReadyList, &lwp->Node);
}
}